import numpy as np
import IHS

if __name__ == "__main__":
    '''
    种群的sizepop = 60；
    变量的维度 = 25；
    变量的边界 = bound;
    最大次数 = 5000；
    HMCR = 0.9950;
    PAR = 0.4;
    '''
    bound = np.tile([[-5.12], [5.12]], 100) #将[[-600],[600]] 沿x轴复制25次

    Ihs=IHS.ImprovedHarmonySearch(40, 100, bound, 100, 0.9950, [0.0005,0.0008],[0.2,0.5])

    #Ihs2 = IHS.ImprovedHarmonySearch(60, 25, bound, 5000, 0.9950, [0.001,0.005],[0.1,0.4])
    Ihs.solve()
    print(np.mean(Ihs.best.chrom))

    #Ihs2.solve()